-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: reduce get overlap operations #5615
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Codecov ReportBase: 75.53% // Head: 75.62% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #5615 +/- ##
==========================================
+ Coverage 75.53% 75.62% +0.09%
==========================================
Files 329 329
Lines 32960 32963 +3
==========================================
+ Hits 24897 24929 +32
+ Misses 5910 5885 -25
+ Partials 2153 2149 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls reslove conflict
server/core/basic_cluster.go
Outdated
bc.Regions.mu.RLock() | ||
origin, overlaps := bc.getRelevantRegionsLocked(region) | ||
bc.Regions.mu.RUnlock() | ||
return bc.check(region, origin, overlaps) | ||
} | ||
|
||
func (bc *BasicCluster) check(region, origin *RegionInfo, overlaps []*RegionInfo) (*RegionInfo, error) { | ||
func (bc *BasicCluster) check(region, origin *RegionInfo, overlaps []*regionItem) (*RegionInfo, []*regionItem, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not necessary to return the input param
server/core/region.go
Outdated
for i, o := range ol { | ||
if o.GetID() == region.GetID() { | ||
ol = append(ol[:i], ol[i+1:]...) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part needs to be paid attention to.
server/core/region.go
Outdated
// SetRegionWithUpdate sets the RegionInfo to regionTree and regionMap and return the update info of subtree. | ||
func (r *RegionsInfo) SetRegionWithUpdate(region *RegionInfo) (*RegionInfo, []*RegionInfo, bool) { | ||
// SetRegion sets the RegionInfo to regionTree and regionMap and return the update info of subtree. | ||
func (r *RegionsInfo) SetRegion(region *RegionInfo, withOverlaps bool, ol ...*regionItem) (*RegionInfo, []*RegionInfo, bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function looks hard to use....and how to guarante overlaps is accurate without lock?
/hold |
/hold cancel |
/hold |
This PR won't be released in v6.5.0. |
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
/hold cancel |
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 4abba8b
|
@rleungx: Your PR was out of date, I have automatically updated it for you. If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
Signed-off-by: Ryan Leung rleungx@gmail.com
What problem does this PR solve?
Issue Number: Ref #5648, #5606.
What is changed and how does it work?
Check List
Tests
Release note